package entity;

public class Page {
	private int pageSize=3;   //椤靛ぇ灏�
	private int curPage=1;    //褰撳墠椤�
	private int totalCount;   //鎬昏褰曟暟
	private int totalPageCount;  // 鎬婚〉鏁�
	private int startPos=0;
	
	public  Page(int curPage,int totalCount) {
		this.curPage = curPage;
		this.totalCount = totalCount;
		this.totalPageCount= this.totalCount%this.pageSize==0?this.totalCount/this.pageSize:this.totalCount/this.pageSize+1;
		
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCurPage() {
		return curPage;
	}
	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}
	public int getTotalCount() {
		totalCount=(totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1);
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	public int getStartPos() {
		startPos=(curPage-1)*pageSize;
		return startPos;
	}
	public void setStartPos(int startPos) {
		this.startPos = startPos;
	}
	
	
}


